home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / structclass.awk < prev   
Encoding:
AWK Script  |  1996-05-05  |  716 b   |  30 lines

  1. BEGIN {OFS="\t"; }
  2. /^#define/ { if ( NF > 1 ) print $2,FILENAME, NR; }
  3. /^[     ]*const[     ][     ]*.*;$/ {
  4.     for (x = 1; x <= NF; ++x) {
  5.         if ($x == "=") { y = x-1; print $y,FILENAME,NR; } 
  6.     }
  7. }
  8. /^[     ]*typedef[     ][     ]*.*;$/ {
  9.     x = NF; l=length($x);
  10.     if(l==1) {
  11.         x = NF-1; print $x,FILENAME,NR;
  12.     } else {
  13.         print substr($x, 1, l-1), FILENAME,NR;
  14.     }
  15. }
  16. /struct[     ][     ]*[a-zA-Z_0-9]*[     ][     ]*{/ {
  17.     if ( NF == 3 ) print $2,FILENAME,NR; else {
  18.         for (x = NF; x > 0; --x) {
  19.             if ($x == "struct") { y = x+1; print $y,FILENAME,NR; }
  20.         } 
  21.     }
  22. }
  23. /class[     ][     ]*[a-zA-Z_0-9]*[     ][     ]*{/ { 
  24.     if ( NF == 3 ) print $2,FILENAME,NR; else { 
  25.         for (x = NF; x > 0; --x) { 
  26.             if ($x == "class") { y = x+1; print $y,FILENAME,NR; } 
  27.         } 
  28.     } 
  29. }
  30.